package org.jackysoft.struts2.portal;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Namespace;
import org.jackysoft.entity.nosql.NewsCatalog;
import org.jackysoft.entity.nosql.Province;
import org.jackysoft.service.ProvinceService;
import org.jackysoft.struts2.UtilsCRUDAction;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

@Controller
@Namespace("/province")
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class ProvinceAction extends UtilsCRUDAction<NewsCatalog> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2629431855424644895L;
	private String name;
	private String firstId;
	private String parentId;
	private ProvinceService service;
    private Province bean;
	
	
	/**
	 * @param page 页码
	 * @param rows 每页数目
	 * @param name 园地名称	 
	 * */
	public String execute() throws Exception{
		
		bean = service.get(page, rows, name,firstId);
		if(!bean.isOpened())
			return "noopen";
	    return SUCCESS;
	}
	
	
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}



	public Province getBean() {
		return bean;
	}


	public void setBean(Province bean) {
		this.bean = bean;
	}


	public ProvinceService getService() {
		return service;
	}

    @Resource
	public void setService(ProvinceService service) {
		this.service = service;
	}



	public String getFirstId() {
		return firstId;
	}



	public void setFirstId(String firstId) {
		this.firstId = firstId;
	}



	public String getParentId() {
		return parentId;
	}



	public void setParentId(String parentId) {
		this.parentId = parentId;
	}






}
